<?php $clientModel = new Admin_Model_Clients();?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span3"><?php echo $this->partial('choix/menu.phtml') ?></div>
        <div class="span9">
            <div class="wrap">
                <div id="main-content">
					<?php if(@$this->escape($message[0]) != ''){?>
					<p align="center"><span class="gras-rouge"><?php echo @$this->escape($message[0]);?></span></p>
					<?php }?>
					<form action="<?php echo $this->baseUrl()?>/admin/clients/insert-clients?org=<?php echo $this->org?>&num_vente=<?php echo $this->num_vente ?>" method="post" name="formCli" class="form-horizontal">
						<h3>Edition</h3>
					  <table align="left" cellpadding="3" cellspacing="0" class="tbl" width="100%" style="text-align:left">
						<tr>
							<td style="text-align:left">Type de client :</td>
							<td style="text-align:left">
								<input name="vendeur" type="checkbox" class="chk" id="checkbox" onclick="typeCli()" value="1" <?php if (@$_SESSION[vendeur] == 1) echo "checked" ?> />
								Vendeur&nbsp;&nbsp;
								<input name="acheteur" type="checkbox" class="chk" id="checkbox" onclick="typeCli()" value="1" <?php if (@$_SESSION[acheteur] == 1) echo "checked" ?> />
								Acheteur&nbsp;&nbsp;
								<input name="contact" type="checkbox" class="chk" id="checkbox" onclick="typeCli()" value="1" <?php if (@$_SESSION[contact] == 1) echo "checked" ?> />
								Contact
							</td>
							<td style="text-align:left">N&deg; Client :</td>
							<td colspan="3" style="text-align:left">
								<label>
									<input name="num_client" type="text" id="textfield" size="4" maxlength="4" value="<?php echo @$_SESSION[num_client] ?>" />
								</label>
							</td>
						</tr>
						<tr>
							<td style="text-align:left">Catégorie :</td>
							<td style="text-align:left">
								<input name="bd" type="checkbox" class="chk" id="checkbox" value="1" <?php if (@$_SESSION[bd] == 1) echo "checked" ?> />
								BD&nbsp;&nbsp;
								<input name="obj" type="checkbox" class="chk" id="checkbox" value="1" <?php if (@$_SESSION[obj] == 1) echo "checked" ?> />
								Objet&nbsp;&nbsp;
								<input name="fg" type="checkbox" class="chk" id="checkbox" value="1" <?php if (@$_SESSION[fg] == 1) echo "checked" ?> />
								Fond de grenier
							</td>
							<td style="text-align:left">%Com : </td>
							<td style="text-align:left"><input name="commission" type="text" id="commission"  value="15" size="4" maxlength="4" /></td>
						</tr>
						<tr>
							<td style="text-align:left">Civilit&eacute; :</td>
							<td style="text-align:left">
								<select name="civilite">
									<option value="0">------</option>
								<?php
									$listCity = $clientModel->getListCity();
									foreach($listCity as $city) :
								?>	
										<option value="<?php echo $city['p_civilites']?>"><?php echo $city['nom']?></option>\n";
								<?php endforeach;?>
								</select>      
							</td>
							<td style="text-align:left">Nom :</td>
							<td colspan="3" style="text-align:left"><input name="nom" type="text" id="nom2" size="50" value="<?php echo @$_SESSION[nom] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">Pr&eacute;nom :</td>
						<td style="text-align:left">
							<input name="prenom" type="text" id="prenom" size="50" value="<?php echo @$_SESSION[prenom] ?>" /></td>
							<td style="text-align:left">c/o :</td>
							<td colspan="3" style="text-align:left"><input name="co" type="text" id="co2" size="50" value="<?php echo @$_SESSION[co] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">Adresse :</td>
							<td style="text-align:left"><input name="adresse" type="text" id="adresse2" size="50" value="<?php echo @$_SESSION[adresse] ?>" /></td>
							<td style="text-align:left">Adresse (suite) :</td>
							<td colspan="3" style="text-align:left"><input name="adresse2" type="text" id="adresse2" size="50" value="<?php echo @$_SESSION[adresse2] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">Code Postal :</td>
							<td style="text-align:left"><input type="text" name="cp" id="cp" value="<?php echo @$_SESSION[cp] ?>" /></td>
							<td style="text-align:left">Ville :</td>
							<td colspan="3" style="text-align:left"><input name="ville" type="text" id="ville2" size="50" value="<?php echo @$_SESSION[ville] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">Pays :</td>
							<td style="text-align:left">
								<select name="pays">
									<?php
									$listPay = $clientModel->getListPay();
									$selected='';
									foreach($listPay as $pay) :
										if (!isset($_SESSION[pays])) {
											if ($pay['nom'] == "Belgique") $selected = " selected";
											else $selected='';
										} else {
											if ($pay['p_pays'] == @$_SESSION[pays]) $selected = "selected";
											else $selected='';
										}
									?>	
										<option value="<?php echo $pay['p_pays']?>" <?php echo $selected ?>><?php echo $pay['nom']&nbsp;?></option>;
									<?php endforeach;?>
								</select>
							</td>
							<td style="text-align:left">T&eacute;l 1 :</td>
							<td colspan="3" style="text-align:left"><input name="tel1" type="text" id="tel8" size="30" value="<?php echo @$_SESSION[tel1] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">T&eacute;l 2 :</td>
							<td style="text-align:left"><input name="tel2" type="text" id="tel6" size="30" value="<?php echo @$_SESSION[tel2] ?>" /></td>
							<td style="text-align:left">T&eacute;l 3 :</td>
							<td colspan="3" style="text-align:left"><input name="tel3" type="text" id="tel7" size="30" value="<?php echo @$_SESSION[tel3] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">T&eacute;l 4 :</td>
							<td style="text-align:left"><input name="tel4" type="text" id="tel5" size="30" value="<?php echo @$_SESSION[tel4] ?>" /></td>
							<td style="text-align:left">N&deg; Compte :</td>
							<td colspan="3" style="text-align:left"><input name="banque" type="text" id="banque2" size="30" value="<?php echo @$_SESSION[banque] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">N&deg; Carte identit&eacute; :</td>
							<td style="text-align:left"><input name="identite" type="text" id="identite2" size="50" value="<?php echo @$_SESSION[identite] ?>" /></td>
							<td style="text-align:left">Email : </td>
							<td colspan="3" style="text-align:left"><input name="email" type="text" id="email2" size="50" value="<?php echo @$_SESSION[email] ?>" /></td>
						</tr>
						<tr>
							<td style="text-align:left">N&deg; TVA :</td>
							<td style="text-align:left"><input name="tva" type="text" id="tva2" size="30" value="<?php echo @$_SESSION[tva] ?>" /></td>
							<td style="text-align:left">Archiver :</td>
							<td colspan="3" style="text-align:left"><input name="archive" type="checkbox" class="chk" id="checkbox" value="1" <?php if (@$_SESSION[archive] == 1) echo "checked" ?> /></td>
						</tr>
						<tr>
							<td style="text-align:left">Catalogue d'office ?</td>
							<td style="text-align:left"><input name="catoffice" type="radio" value="0" checked="checked" class="chk" /> Non <input name="catoffice" type="radio" value="1" class="chk" /> Oui</td>
							<td style="text-align:left">Contacer vente d&eacute;p&ocirc;t :</td>
							<td style="text-align:left"><input name="contact_depot" type="radio" value="0" checked="checked" class="chk" /> Non <input name="contact_depot" type="radio" value="1" class="chk" /> Oui</td>
						</tr>
						<tr>
							<td colspan="6" align="center"><input name="" type="submit" class="btn btn-primary" value=" Sauver " /></td>
						</tr>
					</table>
					</form>
				</div>
            </div>
        </div>
    </div>
</div>